<div class="container">
	<form action="<?=WEB_PATH?>/customer/showcart" method="post">
		<?php if ($this->items) {?>
		<table class="table">
			<tr>
				<th>STT</th>
				<th colspan="2">Sản phầm</th>
				<th>Số Lượng</th>
				<th>Thành tiền</th>
				<th>Xóa</th>
			</tr>
			<?php $total = 0;?>
			<?php foreach($this->items as $key => $item) {?>
			<tr class="<?= $key % 2 == 0? 'success' : ''?>">
				<td> <?= $key + 1?>	</td>
				<td> <div class="product-small-image"><img src="<?=WEB_PATH?>/public/imgs/<?=$item->image_url?>" class="img-max-width"></div></td>				
				<td> <a href="<?=WEB_PATH?>/phone/detail/id/<?=$item->id ?>"> <?= $item->name?></a></td>				
				<td> <input value="<?= $this->cart[$item->id]?>" type="number" min="0" name="itemProduct[<?=$item->id?>]"> </td>				
				<td> <?php 
						 $subTotal = $item->price * $this->cart[$item->id];
						 $total += $subTotal;
						 echo $subTotal;
						 ?></td>				
				<td> <a href="<?=WEB_PATH?>/customer/removecart/id/<?=$item->id?>">Xóa</a> </td>				
			</tr>
			<?php }?>
			<tr>
				<td colspan="4" ><h4 class="pull-right">Tổng cộng:</h4></td>
				<td><h4><?php echo $total?></h4></td>
				<td></td>
			</tr>
			<tr>
				<td colspan="4" ><button type="submit" class="btn btn-success pull-right">Chỉnh sửa</button></td>
				<td><a class="btn btn-success" href="<?=WEB_PATH?>/customer/checkout">Thanh toán</a></td>
				<td></td>
			</tr>
		</table>
		<?php } else {?>
			<h3>Không có sản phẩm nào trong giỏ hàng</h3>
		<?php }?>
	</form>
	
</div>
<!-- /container -->